package com.wms.function.service.impl;

import java.util.List;
        import com.wms.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.wms.function.mapper.TbGoodsOwnerMapper;
import com.wms.function.domain.TbGoodsOwner;
import com.wms.function.service.ITbGoodsOwnerService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import java.util.Arrays;

/**
 * 货主Service业务层处理
 *
 * @author znl
 * @date 2025-02-18
 */
@Service
public class TbGoodsOwnerServiceImpl extends ServiceImpl<TbGoodsOwnerMapper,TbGoodsOwner> implements ITbGoodsOwnerService {
    @Autowired
    private TbGoodsOwnerMapper tbGoodsOwnerMapper;

    /**
     * 查询货主
     *
     * @param id 货主主键
     * @return 货主
     */
    @Override
    public TbGoodsOwner selectTbGoodsOwnerById(Long id) {
                return getById(id);
    }

    /**
     * 查询货主列表
     *
     * @param tbGoodsOwner 货主
     * @return 货主
     */
    @Override
    public List<TbGoodsOwner> selectTbGoodsOwnerList(TbGoodsOwner tbGoodsOwner) {
        return tbGoodsOwnerMapper.selectTbGoodsOwnerList(tbGoodsOwner);
    }

    /**
     * 新增货主
     *
     * @param tbGoodsOwner 货主
     * @return 结果
     */
    @Override
    public int insertTbGoodsOwner(TbGoodsOwner tbGoodsOwner) {
                                                                return save(tbGoodsOwner) ? 1 : 0;
    }

    /**
     * 修改货主
     *
     * @param tbGoodsOwner 货主
     * @return 结果
     */
    @Override
    public int updateTbGoodsOwner(TbGoodsOwner tbGoodsOwner) {
                                                        return updateById(tbGoodsOwner) ? 1 : 0;
    }

    /**
     * 批量删除货主
     *
     * @param ids 需要删除的货主主键
     * @return 结果
     */
    @Override
    public int deleteTbGoodsOwnerByIds(Long[] ids) {
                return removeByIds(Arrays.asList(ids)) ? 1 : 0;
    }

    /**
     * 删除货主信息
     *
     * @param id 货主主键
     * @return 结果
     */
    @Override
    public int deleteTbGoodsOwnerById(Long id) {
                return removeById(id) ? 1 : 0;
    }

}
